/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ProductPanel.java
 *
 * Created on 2011-8-21, 16:24:07
 */
package com.securitytrace.client;

import java.awt.event.ActionListener;

/**
 *
 * @author Administrator
 */
public class ProductPanel extends javax.swing.JPanel {

	private static final long serialVersionUID = -990612273959562261L;
	/** Creates new form ProductPanel */
    public ProductPanel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

		new javax.swing.JSeparator();
        new javax.swing.JLabel();
        new javax.swing.JScrollPane();
        new javax.swing.JTree();
        new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        productNameTextField = new javax.swing.JTextField();
        searchProductButton = new javax.swing.JButton();
        addProductButton = new javax.swing.JButton();
        updateProductButton = new javax.swing.JButton();
        deleteProductButton = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        productTable = new javax.swing.JTable();
        productHomePageButton = new javax.swing.JButton();
        productPreviousPageButton = new javax.swing.JButton();
        productLastPageButton = new javax.swing.JButton();
        productNextPageButton = new javax.swing.JButton();
        productPageInfoLabel = new javax.swing.JLabel();
	
        jLabel1.setText("类别:");
        searchProductButton.setText("搜索");
        addProductButton.setText("新增");
        updateProductButton.setText("修改");
        deleteProductButton.setText("删除");
        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(62, 62, 62)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(productNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(searchProductButton)
                .addGap(43, 43, 43)
                .addComponent(addProductButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(updateProductButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(deleteProductButton)
                .addContainerGap(59, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {addProductButton, deleteProductButton, updateProductButton});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(productNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(searchProductButton)
                .addComponent(addProductButton)
                .addComponent(updateProductButton)
                .addComponent(deleteProductButton))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {addProductButton, deleteProductButton, jLabel1, productNameTextField, searchProductButton, updateProductButton});

        jScrollPane2.setViewportView(productTable);
        /*productTable.getColumnModel().getColumn(0).setMinWidth(130);
        productTable.getColumnModel().getColumn(0).setMaxWidth(15);
        productTable.getColumnModel().getColumn(1).setResizable(false);*/

        productHomePageButton.setText("首  页");
        productPreviousPageButton.setText("上一页");
        productNextPageButton.setText("下一页");
        productLastPageButton.setText("末  页");

        javax.swing.GroupLayout productPanelLayout = new javax.swing.GroupLayout(this);
        this.setLayout(productPanelLayout);
        productPanelLayout.setHorizontalGroup(
            productPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, productPanelLayout.createSequentialGroup()
                .addContainerGap(97, Short.MAX_VALUE)
                .addComponent(productHomePageButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(productPreviousPageButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(productNextPageButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(productLastPageButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(productPageInfoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(72, 72, 72))
            .addGroup(productPanelLayout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(productPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 565, Short.MAX_VALUE))
                .addContainerGap(29, Short.MAX_VALUE))
        );
        productPanelLayout.setVerticalGroup(
            productPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(productPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 447, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(productPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(productHomePageButton)
                    .addComponent(productPreviousPageButton)
                    .addComponent(productNextPageButton)
                    .addComponent(productLastPageButton)
                    .addComponent(productPageInfoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
    protected javax.swing.JButton addProductButton;
    protected javax.swing.JButton deleteProductButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane2;
    protected javax.swing.JButton productHomePageButton;
    protected javax.swing.JButton productLastPageButton;
    protected javax.swing.JTextField productNameTextField;
    protected javax.swing.JButton productNextPageButton;
    protected javax.swing.JLabel productPageInfoLabel;
    protected javax.swing.JButton productPreviousPageButton;
    protected javax.swing.JTable productTable;
    protected javax.swing.JButton searchProductButton;
    protected javax.swing.JButton updateProductButton;
    /***以下为get/set方法**/
	public javax.swing.JTextField getProductNameTextField() {
		return productNameTextField;
	}
	public void setProductNameTextField(javax.swing.JTextField productNameTextField) {
		this.productNameTextField = productNameTextField;
	}
	public javax.swing.JLabel getProductPageInfoLabel() {
		return productPageInfoLabel;
	}
	public void setProductPageInfoLabel(javax.swing.JLabel productPageInfoLabel) {
		this.productPageInfoLabel = productPageInfoLabel;
	}
	public javax.swing.JTable getProductTable() {
		return productTable;
	}
	public void setProductTable(javax.swing.JTable productTable) {
		this.productTable = productTable;
	}
	public void setAddProductButton(ActionListener listener) {
		this.addProductButton.addActionListener(listener);
	}
	public void setDeleteProductButton(ActionListener listener) {
		this.deleteProductButton.addActionListener(listener);
	}
	public void setProductHomePageButton(ActionListener listener) {
		this.productHomePageButton.addActionListener(listener);
	}
	public void setProductLastPageButton(ActionListener listener) {
		this.productLastPageButton.addActionListener(listener);
	}
	public void setProductNextPageButton(ActionListener listener) {
		this.productNextPageButton.addActionListener(listener);
	}
	public void setProductPreviousPageButton(ActionListener listener) {
		this.productPreviousPageButton.addActionListener(listener);
	}
	public void setSearchProductButton(ActionListener listener) {
		this.searchProductButton.addActionListener(listener);
	}
	public void setUpdateProductButton(ActionListener listener) {
		this.updateProductButton.addActionListener(listener);
	}
}
